﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Windows.Data;
using System.Globalization;

namespace BadHabit.Factory.Converters {

    [ValueConversion(typeof(object), typeof(string))]
    public class ArtifactImageConverter : IValueConverter {

 
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
            
            if (value == null)
                return null;
            
            String valueStr = value as String;
            if(valueStr==null)
                return "/Images/Artifacts/artifact.png";


            return "/Images/Artifacts/artifact" + valueStr + ".png";
        }


        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
            return new NotSupportedException();
        }

     
    }
}
